package com.hsyt.pfc.support.util;

import com.github.jknack.handlebars.Handlebars;
import com.github.jknack.handlebars.Template;


public class HandlebarsUtil {
    public static Handlebars handlebars;

    public static String getModuleHtml(String html, Object object) {
        Template template = null;
        String moduleHtml = null;
        try {
            template = handlebars.compileInline(html);
            moduleHtml = template.apply(object);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return moduleHtml;
    }

    public void setHandlebars(Handlebars handlebars) {
        HandlebarsUtil.handlebars = handlebars;
    }

}
